package com.zy.datareceiver.binsess.exec.service;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class ThreadService {

    private static Logger log = LoggerFactory.getLogger(ThreadService.class);

    @Async("taskExecutor")
    public void storageTaskService(Runnable runnable){
        log.info("start work get message from rabbitmq to database");
        runnable.run();
    }

    @Async("taskExecutor")
    public void saveToDbService(Runnable runnable){
        log.info("start save to db thread ");
        runnable.run();
    }

}
